<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * cooperation short summary.
 *
 * cooperation description.
 *
 * @version 1.0
 * @author xianbin
 */
class cooperation extends Pre_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->Model('Cooperation_model');
        $this->load->Model('Contents_model');
    }

    public function cooperationlist()
    {
        $menuid=$this->uri->segment(3);
        $menu_model=$this->Menu_model->get_menu_by_id($menuid);
        //获取seo
        $config_model=$this->get_config();
        $config_model->title= !empty($menu_model->title)?$config_model->title.'_'.$menu_model->title:$config_model->title;
        $data['config_model']=$config_model;

        //获取左侧栏目,顶部栏目元素，面包屑
        $left_nav=null;
        $top_nav_title=null;
        $crumbs=null;
        $icon=null;
        $array_high=$this->get_high_item_left_nav_crumbs($menuid,$left_nav,$top_nav_title,$crumbs,$icon);
        $data['icon']=$icon;
        $data['crumbs']=$crumbs;
        $data['left_nav']=$left_nav;
        $data['top_nav_title']=$top_nav_title;
        //获取高亮栏目
        $data['top_high']=$array_high[0];
        if(count($array_high)>=2)
        {
            $data['left_high']=$array_high[1];
        }
        $data['cooperation_list']=$this->Cooperation_model->get_all_cooperation_by_menuid($menuid);
        $this->load->view('Pre/cooperation/cooperationlist.html',$data);
    }

    public function cooperationinfo()
    {
        $menuid=$this->uri->segment(3);
        $content_model=$this->Contents_model->get_first_row_by_menuid($menuid);
        //获取seo
        $config_model=$this->get_config();
        $config_model->title= !empty($content_model->title)?$config_model->title.'_'.$content_model->title:$config_model->title;
        $config_model->keyword= !empty($content_model->keyword)?$content_model->keyword:$config_model->keyword;
        $config_model->description= !empty($content_model->description)?$content_model->description:$config_model->description;

        $data['content_model']=$content_model;
        $data['config_model']=$config_model;

        //获取左侧栏目,顶部栏目元素，面包屑
        $left_nav=null;
        $top_nav_title=null;
        $crumbs=null;
        $icon=null;
        $array_high=$this->get_high_item_left_nav_crumbs($menuid,$left_nav,$top_nav_title,$crumbs,$icon);
        $data['icon']=$icon;
        $data['crumbs']=$crumbs;
        $data['left_nav']=$left_nav;
        $data['top_nav_title']=$top_nav_title;
        //获取高亮栏目
        $data['top_high']=$array_high[0];
        if(count($array_high)>=2)
        {
            $data['left_high']=$array_high[1];
        }
        $this->load->view('Pre/contents/contentsinfo.html',$data);
    }
}